<?php

namespace app\http\middleware;

use Firebase\JWT\BeforeValidException;
use Firebase\JWT\JWT;
use Firebase\JWT\SignatureInvalidException;
use think\Db;
use think\facade\Request;

class checkUserAuth
{
    public function handle(\think\Request $request, \Closure $next)
    {
        $user_id = Request::param('user_id');
        $user = Db::table('user')->where('id', $user_id)->find();
        if ($user['status'] == 0) {
            die(json_encode(toResful(400, '', "该账户已被封禁")));
        } else {
            return $next($request);
        }

    }
}